package com.lemurian.bankdata.servicebean;

import java.util.Date;
import java.util.List;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.lemurian.bankdata.bean.ManagementDAO;
import com.lemurian.bankdata.lite.struts.PartialList;
import com.lemurian.bankdata.report.dto.RekapSertifikat;
import com.lemurian.bankdata.services.ManagementService;
import com.lemurian.entity.Management;

@Service("managementService")
@Transactional(readOnly=true)
public class ManagementBean implements ManagementService {

	@Autowired private ManagementDAO dao;
	
	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void delete(Management entity) {
		dao.delete(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void delete(int id) {
		dao.delete(id);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public int delete(String sql) {
		return dao.delete(sql);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<Management> findAll() {
		return dao.findAll();
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<Management> findAll(Order order) {
		return dao.findAll(order);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<Management> findByCriteria(Order order, Criterion... criterion) {
		return dao.findByCriteria(order, criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public PartialList<Management> findByCriteria(int start, int count, Order order, Criterion... criterion) {
		return dao.findByCriteria(start, count, order, criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public Management findByCriteria(Criterion... criterion) {
		return dao.findByCriteria(criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public Management findById(int id) {
		return dao.findById(id);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public Management load(int id) {
		return dao.load(id);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public Management save(Management entity) {
		return dao.save(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public Management update(Management entity) {
		return dao.update(entity);
	}

	@Override
	public List<RekapSertifikat> summaryReport(Date startTime, Date endTime, Boolean status) {
		return dao.summaryReport(startTime, endTime, status);
	}

	@Override
	public PartialList<Management> delegasiKurirList(int start, int count, Order order, Criterion... criterion) {
		return dao.delegasiKurirList(start, count, order, criterion);
	}

	@Override
	public Management findByIdJoinManagementType(int id) {
		return dao.findByIdJoinManagementType(id);
	}

}